﻿using _10_01Prism框架.Views;
using Prism.DryIoc;
using Prism.Ioc;
using Prism.Modularity;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
using _10_02Prism模块化ModuleA;
using _10_03Prism模块化ModuleB;
using _10_06Prism模块化ModuleC;

namespace _10_01Prism框架
{
	/// <summary>
	/// Interaction logic for App.xaml
	/// </summary>
	public partial class App : PrismApplication
	{
		protected override Window CreateShell()
		{
			return Container.Resolve<MainView>();
		}


		/// <summary>
		/// 方法1 直接通过导航同项目下的用户控件去
		/// </summary>
		/// <param name="containerRegistry"></param>
		protected override void RegisterTypes(IContainerRegistry containerRegistry)
		{ 
			//containerRegistry.RegisterForNavigation<ViewA>();
			//containerRegistry.RegisterForNavigation<ViewB>();
			//containerRegistry.RegisterForNavigation<ViewC>();
		}

		/// <summary>
		/// 方法2  利用强引用的关系去做，就是在引用里调用一次
		/// </summary>
		/// <param name="moduleCatalog"></param>
		protected override void ConfigureModuleCatalog(IModuleCatalog moduleCatalog)
		{
			moduleCatalog.AddModule<ModuleAProfile>();
			moduleCatalog.AddModule<ModuleBProfile>();
			moduleCatalog.AddModule<ModuleCProfile>();
			base.ConfigureModuleCatalog(moduleCatalog);
		}
	}
}
